package A01File;

import java.io.File;

public class FileTest03 {
    public static void main(String[] args) {
        File file = new File("D:\\File\\aaa");
        DeleteSrc(file);
    }

    public static void DeleteSrc(File src) {
        File[] files = src.listFiles();
        for (File file : files) {
            if(file.isFile()){
                file.delete();
            }else {
                DeleteSrc(file);
            }
        }
        src.delete();
    }
}
